package com.mystore.framework.service.impl;

import com.mystore.common.utils.string.RedisKeyStringUtils;
import com.mystore.framework.service.RedisService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
@Service
public class RegisterRedisServiceImpl extends RedisServiceImpl {
    @Resource
    public void setRedisTemplate(RedisTemplate<String,Object> redisTemplate){
        super.redisTemplate=redisTemplate;
    }
    private static final String SUFFIX="verifyCode";

    public void put(String key, Object value) {
        put(key,value,SUFFIX,5,TimeUnit.MINUTES);
    }

   public Object get(String key) {
        return get(key,SUFFIX);
    }
    public void delete(String key) {
       delete(key,SUFFIX);
    }
}
